﻿
Imports System.Data.Common
Imports System.Data.Odbc

Namespace Db.Helper

    ''' <summary>ＳＱＬエラーコード</summary>
    Public Enum OdbcErrorNumbers
        '''' <summary>重複エラーコード</summary>
        'DuplicationPKey = 3621
        ''' <summary>タイムアウトエラーコード</summary>
        TimeOut = -2146232009
    End Enum

    Public Class OdbcAccessHelper
        Inherits DbAccessHelper
		Implements IDbAccessHelper

		''' <summary>ＳＱＬコネクション</summary>
		Private _conn As OdbcConnection

#Region " コンストラクタ "

		''' <summary>
		''' コンストラクタ
		''' </summary>
		''' <param name="dba">使用するデータベースアクセス</param>
		''' <remarks></remarks>
		Public Sub New(ByVal dba As IDao)
			MyBase.New(dba)
			_conn = DirectCast(Me.myDba.Connection, OdbcConnection)
		End Sub

#End Region

		Public Function CDbParameterName(ByVal name As String) As String Implements IDbAccessHelper.CDbParameterName
			Return Nothing
		End Function

		Public Function ErrorCount(ByVal ex As System.Exception) As Integer Implements IDbAccessHelper.ErrorCount

		End Function

		Public Function GetSchemaColumns(ByVal table As DbInfoTable) As DbInfoColumnCollection Implements IDbAccessHelper.GetSchemaColumns
			Return Nothing
		End Function

		Public Function GetSchemaFunctions() As DbInfoFunctionCollection Implements IDbAccessHelper.GetSchemaFunctions
			Return Nothing
		End Function

		Public Function GetSchemaProcedures() As DbInfoProcedureCollection Implements IDbAccessHelper.GetSchemaProcedures
			Return Nothing
		End Function

		Public Function GetSchemaTables() As DbInfoTableCollection Implements IDbAccessHelper.GetSchemaTables
			Return Nothing
		End Function

		Public Function GetSchemaTable(tablename As String) As DbInfoTable Implements IDbAccessHelper.GetSchemaTable
			'TODO: 未実装
			Return Nothing
		End Function

		Public Function HasSqlNativeError(ByVal ex As System.Exception, ByVal errorNumber As Long) As Boolean Implements IDbAccessHelper.HasSqlNativeError

		End Function

		Public Function HasSqlNativeErrorDuplicationPKey(ByVal ex As System.Exception) As Boolean Implements IDbAccessHelper.HasSqlNativeErrorDuplicationPKey

		End Function

		Public Function HasSqlNativeErrorTimtout(ByVal ex As System.Exception) As Boolean Implements IDbAccessHelper.HasSqlNativeErrorTimtout

		End Function

		Public ReadOnly Property PlaceholderMark() As String Implements IDbAccessHelper.PlaceholderMark
			Get
				Return "?"
			End Get
		End Property

		Public Sub RefreshProcedureParameters(ByVal cmd As System.Data.IDbCommand) Implements IDbAccessHelper.RefreshProcedureParameters

		End Sub

		Public Function ErrorNumbers(ex As System.Exception) As String() Implements IDbAccessHelper.ErrorNumbers
			Return Nothing
		End Function

	End Class

End Namespace
